//  封装所有与频道相关的网络请求
import myaxios from '@/utils/request.js'

// 得到当前用户的频道
function channelsListGet () {
  return myaxios({
    url: '/app/v1_0/user/channels',
    method: 'get',
    needToken: true
  })
}

// 得到所有的频道
function getAllChannels () {
  return myaxios({
    url: '/app/v1_0/channels',
    method: 'get',
    needToken: false
  })
}

// 修改频道
function updateChannels (mychannel) {
  return myaxios({
    url: '/app/v1_0/user/channels',
    method: 'put',
    needToken: true,
    data: {
      channels: mychannel
    }
  })
}

export { channelsListGet, getAllChannels, updateChannels }
